#!/bin/bash
#####################################################
# Author: Jiaion - jiaion21@gmail.com
# Last modified: 2011-02-18 22:51
# Filename: Queued.sh
#####################################################
export PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Scripts=Queued.sh
__ALL__=(${__ALL__[@]}  )

function Start
{
  python /opt/Django/Myweb/Queue/ExecQueue.py
}

function Stop
{
  kill -9 `ps aux | awk '/Queue.py$/ { print $2}'`
}

function HELP
{
  echo "$0 usage : {start|stop|restart}"
}

function Main
{
  case $1 in
    start)
      Start
      ;;
    stop)
      Stop
      ;;
    restart)
      Stop
      Start
      ;;
    *)
      HELP
      ;;
  esac
}
if [ "${0##*/}" == "${Scripts}" ] ; then
  Main $@
fi 
